//*****************************************************************************
// Classification:   UNCLASSIFIED//FOUO
//
// NAME:  GeoidzEllipsoid.java
//
// AUTHOR/DATE:  Mark  12/15/11
//
// DESCRIPTION: 
//
//*****************************************************************************

/*Expression selection is undefined on line 12, column 5 in Templates/Classes/Class.java.*/
package com.mark.geoidz.modules.geoidz_Core.shapes;

import gov.nasa.worldwind.geom.Angle;
import gov.nasa.worldwind.geom.Position;
import gov.nasa.worldwind.render.BasicShapeAttributes;
import gov.nasa.worldwind.render.Ellipsoid;

/**
 *
 * @author Mark
 */
public class GeoidzEllipsoid extends GeoidzShape
{
   // <editor-fold defaultstate="expanded" desc="Private Members">

   

   // </editor-fold>
   
   // <editor-fold defaultstate="expanded" desc="Constants">
   
   public static final int ELLIPSOID_MIN_PARAMS = 4;
   
   // </editor-fold>

   // <editor-fold defaultstate="expanded" desc="Constructor(s)">

   public GeoidzEllipsoid()
   {
      super(GeoidzShapeFactory.ShapeType_e.ELLIPSOID);
   }

   // </editor-fold>

   // <editor-fold defaultstate="expanded" desc="Working Functions">

   /**
    * Initializes this ellipsoid with the given initial parameters
    * @param aInitialAttributes Variable sized parameter list for initial attributes
    * of the shape.  Attribute list must include the following for an ellipsoid:
    * 
    *    {Position, double, double, double}  OR
    *    {Position, double, double, double, Angle, Angle, Angle}
    */
   @Override
   protected void initShape(Object ... aInitialAttributes)
   {
      if (aInitialAttributes.length >= ELLIPSOID_MIN_PARAMS)
      {
         // Required params
         Position centerPosition = (Position)aInitialAttributes[0];
         double northSouthRadius = (Double)aInitialAttributes[1];
         double verticalRadius = (Double)aInitialAttributes[2];
         double eastWestRadius = (Double)aInitialAttributes[3];

         // Optional params
         Angle heading = (aInitialAttributes.length >= ELLIPSOID_MIN_PARAMS+1) ? 
                      (Angle)aInitialAttributes[4] : Angle.ZERO;

         Angle tilt = (aInitialAttributes.length >= ELLIPSOID_MIN_PARAMS+2) ? 
                      (Angle)aInitialAttributes[5] : Angle.ZERO;

         Angle roll = (aInitialAttributes.length >= ELLIPSOID_MIN_PARAMS+3) ? 
                      (Angle)aInitialAttributes[6] : Angle.ZERO;

         this.mShape = new Ellipsoid(  centerPosition, 
                                       northSouthRadius, 
                                       verticalRadius, 
                                       eastWestRadius, 
                                       heading, 
                                       tilt, 
                                       roll);
         
         this.mAttributes = new BasicShapeAttributes();
         this.mShape.setAttributes(this.mAttributes);
      }
   }

   // </editor-fold>


   // <editor-fold defaultstate="expanded" desc="Properties">

   

   // </editor-fold>

   
}
